﻿namespace dPet.Infrastructure.EntityFramework.ModelConfigurations
{
	using dPet.Domain.Models;
	using Hangerd.EntityFramework;

	public class ProductInventoryConfig : EntityTypeConfigBase<ProductInventory>
	{
		public ProductInventoryConfig()
		{
			HasRequired(pi => pi.Product)
				.WithMany(p => p.Inventories);

			Property(pi => pi.InventoryNumber)
				.IsRequired()
				.HasMaxLength(32);

			Property(pi => pi.Quantity)
				.IsRequired();

			Property(pi => pi.ExpiryTime)
				.IsRequired();
		}
	}
}
